package com.dailyblue.java.spring.mvc.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
import org.springframework.web.servlet.view.InternalResourceViewResolver;

// 会在Tomcat启动时加载
public class InitTomcatStarter extends AbstractAnnotationConfigDispatcherServletInitializer {

    // 加载Ioc配置文件
    protected Class<?>[] getRootConfigClasses() {
        return new Class[0];
    }

    // 加载MVC配置文件
    protected Class<?>[] getServletConfigClasses() {
        return new Class[]{SpringMVCConfig.class};
    }

    // 什么请求会被加载
    protected String[] getServletMappings() {
        return new String[]{"/"};
    }
}
